﻿<h3>About this example</h3>

@{ Html.Telerik().TabStrip()
        .Name("code-viewer-tabs")
        .Items(tabstrip =>
        {
            bool hasDescription = !string.IsNullOrEmpty(ViewData.Get<IHtmlString>("Description").ToString());
            if (hasDescription)
            {
                tabstrip.Add()
                    .Text("Description")
                    .Content(@<text>
                        <div class="description">@ViewData["Description"] </div>
                    </text>);
            }

            var codeFiles = ViewData.Get<Dictionary<string, string>>("codeFiles");

            foreach (var codeFile in codeFiles)
            {
                tabstrip.Add()
                        .Text(codeFile.Key)
                        .LoadContentFrom("CodeFile", "Home", new { file = codeFile.Value });
            }
        })
        .SelectedIndex(0)
        .ClientEvents(events => events.OnLoad("codeTabLoad"))
        .Render();
}